<link rel="stylesheet" href="../scripts/uniform/css/uniform.default.css" media="screen" />
<script src="../scripts/uniform/jquery.uniform.js"></script>
<script type="text/javascript">
    $(document).ready(function()
    {
        $("select").uniform();
    });
</script>
<?php
    function __autoload($class_name)
	{
		include_once('../classes/'.strtolower($class_name).'.php');
	}
    
    $MaLoaiSanPhamCap2 = 0;
    
    if(isset($_POST['MaLoaiSanPhamCap2']))
        $MaLoaiSanPhamCap2 = $_POST['MaLoaiSanPhamCap2'];
    
    $loaisanphamc2 = new loaisanphamc2bs();
    $loaisanphamc2->MaLoaiSanPhamCap2 = $MaLoaiSanPhamCap2;
    $ret_loaisanphamc2 = $loaisanphamc2->getList();
    
    $loaisanphamc1 = new loaisanphamc1bs();
    $loaisanphamc1->MaLoaiSanPhamCap1 = $ret_loaisanphamc2[0]['MaLoaiSanPhamCap1']; //mã sản phẩm cấp 1
    $ret_loaisanphamc1 = $loaisanphamc1->getList();
    
    $loaisanpham = new loaisanphambs();
    $loaisanpham->MaLoaiSanPham = $ret_loaisanphamc1[0]['MaLoaiSanPham'];
	$ret_loaisanpham = $loaisanpham->getList();
    
    echo '<p class="fieldset" id="LoaiSanPham">
        <label>Loại sản phẩm &nbsp;</label>
        <select name="MaLoaiSanPham" disabled="disabled">';
			for($i = 0; $i < ($ret_loaisanpham != false ? count($ret_loaisanpham) : 0); $i++)
			{
				echo "<option value=\"{$ret_loaisanpham[$i]['MaLoaiSanPham']}\">{$ret_loaisanpham[$i]['TenLoaiSanPham']}</option>";
			}
	echo '</select></p>';
    
    echo '<p class="fieldset" id="LoaiSanPhamCap1">
        <label>Loại sản phẩm cấp 1</label>';
    echo '<select name="MaLoaiSanPhamCap1" id="MaLoaiSanPhamCap1" disabled="disabled">';
			
			for($i = 0; $i < ($ret_loaisanphamc1 != false ? count($ret_loaisanphamc1) : 0); $i++)
			{
				echo "<option value=\"{$ret_loaisanphamc1[$i]['MaLoaiSanPhamCap1']}\">{$ret_loaisanphamc1[$i]['TenLoaiSanPhamCap1']}</option>";
			}
	echo '</select></p>';
?>